package com.mdd.front.validate.refund;

import com.mdd.common.validator.annotation.IDMust;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 订单退款参数
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class OrderRefundParam implements Serializable {

    private static final long serialVersionUID = 1L;

    public interface create{}
    public interface update{}
    public interface delete{}

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Long id;

    @NotNull(message = "sn参数缺失", groups = {create.class, update.class})
    @Length(max = 32, message = "sn参数不能超出32个字符", groups = {create.class, update.class})
    private String sn;

    @NotNull(message = "orderId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "orderId参数值不能少于0", groups = {create.class, update.class})
    private Long orderId;

    @NotNull(message = "userId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "userId参数值不能少于0", groups = {create.class, update.class})
    private Long userId;

    @NotNull(message = "type参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "type参数值不能少于0", groups = {create.class, update.class})
    private Integer type;

    @NotNull(message = "orderTerminal参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "orderTerminal参数值不能少于0", groups = {create.class, update.class})
    private Integer orderTerminal;

    @NotNull(message = "transactionId参数缺失", groups = {create.class, update.class})
    @Length(max = 40, message = "transactionId参数不能超出40个字符", groups = {create.class, update.class})
    private String transactionId;

    @NotNull(message = "orderAmount参数缺失", groups = {create.class, update.class})
    @Length(max = 10, message = "orderAmount参数不能超出10个字符", groups = {create.class, update.class})
    private BigDecimal orderAmount;

    @NotNull(message = "refundAmount参数缺失", groups = {create.class, update.class})
    @Length(max = 10, message = "refundAmount参数不能超出10个字符", groups = {create.class, update.class})
    private BigDecimal refundAmount;

    @NotNull(message = "refundStatus参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "refundStatus参数值不能少于0", groups = {create.class, update.class})
    private Integer refundStatus;

    private String remark;//准备
    private Integer reviewStatus;//审核状态：0-待审核；1-审核通过；2-审核不通过

}
